package com.metaverse.backend.domain;

import com.metaverse.backend.annotations.Searchable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("系统配置")
public class SysConfig extends BaseAuditedEntity {

    public enum ValueType {
        STRING,
        TIME,
        DATE,
        DATETIME,
        BOOLEAN,
        NUMBER,
        FILE,
        LIST,
    }

    @Searchable
    @Id
    @Column(length = 25, unique = true)
    @ApiModelProperty(value = "名称")
    private String name;

    @Searchable
    @Column(name = "description")
    @ApiModelProperty(value = "描述")
    private String desc;

    @ApiModelProperty(value = "值")
    private String value;

    @ApiModelProperty(value = "值类型")
    @Enumerated(EnumType.STRING)
    private ValueType type;

    @ApiModelProperty(value = "可选内容")
    @Column(columnDefinition = "TEXT")
    private String optionMap;

}
